﻿$(document).ready(function () {
    $('#btnSubmit').click(function (e) {
        e.preventDefault();
        $('#contentArea').html('').addClass('progress');
        sendData();
    });
});

function sendData() {
    //    var loc = window.location.href;
    //    loc = (loc.substr(loc.length - 1, 1) == "/") ? loc + "Default.aspx" : loc;

    $.ajax({
        type: "POST",
        //        url: loc + "/ServerTime",
        url: "Default.aspx/ServerTime",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            $("#contentArea").removeClass("progress");
            $("#contentArea").html(msg.d);
        },
        error: function () {
            alert("An unexpected error has occurred during processing.");
        }
    });
}